package com.woniuxy.controller;

import com.woniuxy.service.ExceptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: ideaAdmin
 * TODO: 测试异常解析器
 * Date: 2022/2/11:17:19
 * Description:
 */
@Controller
public class ExceptionController {

    @Autowired
    private ExceptionService exceptionService;

    @RequestMapping("/exception/test")
    public String exceptionTest() {
        exceptionService.test();
        return "aaa";
    }

    //使用注解的方法处理异常
    @RequestMapping("/exception/annotation")
    public String exceptionAnnotation() {
        exceptionService.annotationTest();
        return "aaa";
    }
}
